const webpackApiMocker = require('mocker-api')
const path = require('path')
module.exports = {
  // 代理配置
  devServer: {
    open: true,
    hotOnly: true,
    proxy: {
      '/': {
        target: process.env.VUE_APP_BASE_URL,
        secure: false,
        changeOrigin: true,
        ws: true
      }
    },
    before(app) {
      webpackApiMocker(app, path.resolve('./mock/index.js'))
    }
  },
  // 2021/07/05 oyd 解决vue antd按需加载报错
  // 参考: https://blog.csdn.net/lhz_333/article/details/116750568
  css: {
    loaderOptions: {
      less: {
        javascriptEnabled: true,
      }
    },
  },
}
